package com.org.gsc.zsqdemos.adapters;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.org.gsc.zsqdemos.fragments.A;

import java.util.List;

/**
 * Created by qundui on 2017/6/17.
 */

public class MypstAdapter extends FragmentPagerAdapter {

    List<String>  Titles;

    public MypstAdapter(FragmentManager fm, List<String> titles) {
        super(fm);
        Titles = titles;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return Titles.get(position);
    }

    @Override
    public Fragment getItem(int position) {
        return A.newInstance(position);
    }

    @Override
    public int getCount() {
        return Titles.size();
    }
}
